import { RobCityStepPanelBase } from "../RobCityStepPanelBase";
import { ObjCreate } from "../../common/ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { CopyConfig } from "../../../resource/CopyConfig";
import { ItemsBox } from "../../common/item/ItemsBox";
import { RobCityStepZeroOwnerPanel } from "./RobCityStepZeroOwnerPanel";
import { LoaderHelp } from "../../../../common/display/LoaderHelp";
import { ResFileConst } from "../../../resource/ResFileConst";
import { SLookupPlayerReply } from "../../../../../Message/Game/SLookupPlayerReply";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
type int = number;
//class RobCityStepZeroPanel
    
    export  class RobCityStepZeroPanel extends RobCityStepPanelBase
    {
        constructor()
        {
            super();
            this.initUI();
            return;
        }

        /* internal  */initUI(): void
        {
            var loc3=null;
            ObjCreate.createBg(0, 0, 804, 386, this);
            ObjCreate.createGImageBitmap(ImagesConst.RobCityBg0, 2, 70, this);
            ObjCreate.createGImageBitmap(ImagesConst.RobCityTextDesc, 25, 2, this);
            ObjCreate.createBg(20, 70, 770, 2, this, ImagesConst.SplitLine);
            var loc1=GlobalStyle.setTextFormatLeading(GlobalStyle.textFormat1, 3);
            loc1.indent = 24;
            this.desc1 = ObjCreate.createGTextField("", 120, 76, 460, 20, this, loc1, false, false);
            this.desc1.wordWrap = true;
            this.desc1.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this.desc1.htmlText = CopyConfig.instance.getRobCopyDesc(0);
            ObjCreate.createBg(20, 145, 570, 2, this, ImagesConst.SplitLine);
            this.desc2 = ObjCreate.createGTextField("", 120, 151, 460, 20, this, loc1, false, false);
            this.desc2.wordWrap = true;
            this.desc2.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this.desc2.htmlText = CopyConfig.instance.getRobCopyDesc(1);
            ObjCreate.createBg(186, 210, 335, 48, this, ImagesConst.RemainningTimeBg);
            var loc2=new ItemsBox();
            loc2.x = 230;
            loc2.y = 218;
            loc2.setItems(CopyConfig.instance.getRobCopyRewards(0));
            this.addChild(loc2);
            ObjCreate.createBg(20, 266, 570, 2, this, ImagesConst.SplitLine);
            this.desc3 = ObjCreate.createGTextField("", 120, 272, 460, 20, this, loc1, false, false);
            this.desc3.wordWrap = true;
            this.desc3.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this.desc3.htmlText = CopyConfig.instance.getRobCopyDesc(2);
            ObjCreate.createBg(186, 331, 335, 48, this, ImagesConst.RemainningTimeBg);
            loc3 = new ItemsBox();
            loc3.x = 230;
            loc3.y = 339;
            loc3.setItems(CopyConfig.instance.getRobCopyRewards(1));
            this.addChild(loc3);
            ObjCreate.createBg(595, 70, 2, 305, this, ImagesConst.VSpliteLine);
            this._ownerPanel = new RobCityStepZeroOwnerPanel();
            this._ownerPanel.x = 600;
            this._ownerPanel.y = 70;
            this.addChild(this._ownerPanel);
            LoaderHelp.addResCallBack(ResFileConst.robCity, this.onLoadedRes);
            return;
        }

        /* internal  */onLoadedRes(): void
        {
            if (this._loaded) 
            {
                return;
            }
            this._loaded = true;
            ObjCreate.createBitmap(ImagesConst.RobCityTextBg, 32, 80, this);
            ObjCreate.createBitmap(ImagesConst.RobCityTextBg, 32, 170, this);
            ObjCreate.createBitmap(ImagesConst.RobCityTextBg, 32, 287, this);
            ObjCreate.createBitmap(ImagesConst.RobCityText1, 20, 120, this);
            ObjCreate.createBitmap(ImagesConst.RobCityText2, 20, 210, this);
            ObjCreate.createBitmap(ImagesConst.RobCityText3, 20, 327, this);
            return;
        }

        public /* override */ updateStatus(arg1: int): void
        {
            this._ownerPanel.updateStatus();
            return;
        }

        public updateWorshipDummyNum(arg1: int): void
        {
            this._ownerPanel.updateWorshipDummyNum(arg1);
            return;
        }

        public updateSTChatelainInfo(arg1: SLookupPlayerReply): void
        {
            this._ownerPanel.updateSTChatelainInfo(arg1);
            return;
        }

        /* internal */ /* var */desc1: GTextFiled;

        /* internal */ /* var */desc2: GTextFiled;

        /* internal */ /* var */desc3: GTextFiled;

        /* internal */ /* var */_ownerPanel: RobCityStepZeroOwnerPanel;

        /* internal */ /* var */_loaded: Boolean=false;
    }
